/**
 * 
 */
package mdb.com.vn.web.view;

import java.io.Serializable;
import java.util.List;

import javax.faces.model.ListDataModel;

import mdb.com.vn.model.LoansSMS;

import org.primefaces.model.SelectableDataModel;

/**
 * @author tu.dod
 *
 */

public class LoansSmsDataModel extends ListDataModel<LoansSMS> implements
SelectableDataModel<LoansSMS>, Serializable {

/**
* 
*/
private static final long serialVersionUID = 1L;

public LoansSmsDataModel() {
}
public LoansSmsDataModel(List<LoansSMS> loansData) {
super(loansData);
}

@SuppressWarnings("unchecked")
@Override
public LoansSMS getRowData(String rowKey) {
// TODO Auto-generated method stub
List<LoansSMS> loans = (List<LoansSMS>) getWrappedData();
for (LoansSMS loans2 : loans) {
	if (loans2.getRefNo().equals(rowKey)){
		return loans2;
	}
}
return null;
}

@Override
public Object getRowKey(LoansSMS loans) {
// TODO Auto-generated method stub
return loans.getRefNo();
}

}
